<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="org.apache.commons.collections.MapIterator"%>
<%@page import="org.apache.commons.collections.map.ListOrderedMap"%>
<%@ page import = "java.util.*,com.ibatis.sqlmap.client.SqlMapClient,com.meetablog.util.SqlMapConfig" %>   
<%!
	private String S_EMAIL = "";
	private String S_ISLOGIN = "false";
	private String S_AUTH = "";
%>
<%
	HashMap param = new HashMap();	//	검색조건을 담을 해쉬맴 (key, value);
	param.put("E_MAIL",request.getParameter("test"));
	param.put("PW",request.getParameter("test"));
	SqlMapClient sqlMap =  SqlMapConfig.getSqlMapClient();

	if(S_ISLOGIN=="false"){
		
		ArrayList rs = 	(ArrayList)sqlMap.queryForList("TEST.getSession",param);	//	실행할 SQL ID, 검색조건(없을경우 null)
		
		if(rs.size() > 0){
			session.setAttribute("email", ((HashMap)rs.get(0)).get("E_MAIL")); //세션에 값 입력 
			S_ISLOGIN = "true";
			session.setAttribute("auth", ((HashMap)rs.get(0)).get("E_MAIL")); //세션에 값 입력 
			S_EMAIL = session.getAttribute("email").toString(); //세션의 값을 가져올 때 
			S_AUTH = session.getAttribute("auth").toString(); //세션의 값을 가져올 때 
		}
	}
		

out.println("S_EMAIL :" +S_EMAIL+"<br>");
out.println("S_AUTH :" +S_AUTH+"<br>");
out.println("S_ISLOGIN :" +S_ISLOGIN+"<br>");
 
%> 
